import {getToken} from "@/utils/auth"

const user = {
    state: {
        token: getToken(),
        loading: {
            message: '努力加载中...',
            is_show: false,
        }
    },

    mutations: {
        SET_TOKEN: (state, token) => {
            console.log('SET_TOKEN')
            state.token = token
        },
        SHOW_LOADING:(state, loading_message) => {
            state.loading = {
                message: loading_message,
                is_show: true
            };
        },
        HIDE_LOADING: (state) => {
            state.loading = {
                message: '努力加载中...',
                is_show: false
            }
        }
    },

    actions: {
    }
}

export default user